<?php
class TreeTakProgressVo extends SzAbstractMySqlVo
{

    private $userId;
    private $type;
    private $progress;

    /**
     * Initialize TreeTakProgressVo.
     *
     * @param $userId
     * @param $type
     * @param $progress
     * @param boolean $isInsert default false, means for now this vo is initialized not for insert process
     * @return TreeTakProgressVo
     */
    public function __construct($userId, $type, $progress, $isInsert = false) {
        $this->userId = $userId;
        $this->type = $type;
        $this->progress = $progress;

        $this->isInsert = $isInsert;
        $this->voClassName = 'TreeTakProgressVo';
        $this->ormName = 'TreeTakProgress';
    }

    /**
     * @see SzAbstractVo::toArray
     */
    public function toArray($needEncode = false)
    {
        return array(
            'userId' => $this->getUserId(),
            'type' => $this->getType(),
            'progress' => $this->getProgress(),
        );
    }

    /**
     * @see SzAbstractVo::toEntireArray
     */
    public function toEntireArray($needEncode = false)
    {
        return array(
            'userId' => $this->getUserId(),
            'type' => $this->getType(),
            'progress' => $this->getProgress(),
        );
    }

    /**
     * @see SzAbstractVo::toPureArray
     */
    public function toPureArray()
    {
        return array(
            $this->getUserId(),
            $this->getType(),
            $this->getProgress(),
        );
    }

    public function getUserId()
    {
        return $this->userId;
    }

    public function setUserId($val)
    {
        $this->saveColumnStatus(0, $this->userId);
        $this->userId = $val;
    }

    public function getType()
    {
        return $this->type;
    }

    public function setType($val)
    {
        $this->saveColumnStatus(1, $this->type);
        $this->type = $val;
    }

    public function getProgress()
    {
        return $this->progress;
    }

    public function setProgress($val)
    {
        $this->saveColumnStatus(2, $this->progress);
        $this->progress = $val;
    }

    public function updateProgress($val)
    {
        $this->saveColumnStatus(2, $this->progress);
        $this->progress += $val;
    }

}